DEV: add Knowledge Assistant (RAG) agent type to agent builder#3376
DEV: add Knowledge Assistant (RAG) agent type to agent builder#3376mich-elle-luna wants to merge 3 commits into
Conversation
Adds a third agent type — Knowledge Assistant — to the interactive agent builder, alongside the existing Recommendation Engine and Conversational Assistant. Includes Python and Node.js templates with Redis-native hybrid retrieval, semantic caching, session memory, and citations. - Python template: single redis-py client (decode_responses=False), redisvl for index creation only, FT.SEARCH hybrid query with vector-only fallback, load_directory() helper, idempotent sample doc ingestion - Node.js template: node-redis v4, same hybrid search pattern, loadDirectory() helper, ft.info() guard to skip re-ingestion on restart - agent-builder.js: adds rag type to CONFIG, enables JavaScript alongside Python, fixes root-relative template URL, adds third suggestion chip - agent-builder.html: adds Knowledge Assistant chip to initial message - _index.md: updated to mention three agent types and JS support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Hardcoded /code/agent-templates/ broke on staging when the site is served from a subdirectory. Hugo's relURL now injects the correct base path as window.AGENT_TEMPLATE_BASE so the XHR resolves relative to wherever the site is deployed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
The RAG example looks to be complete for both Python and JavaScript. But the other two show incomplete JavaScript code. I'm seeing these kinds of errors in the Chrome debugger's console:
Template file not found: /docs/staging/agent-builder-rag/code/agent-templates/javascript/recommendation_agent.js (404)
So what the JavaScript is showing is the default code that lives somewhere (in the static/js/agent-builder.js file maybe?).
|
ah thanks, those are the new templates that are in my other PR I think |
- Fix semantic cache never firing: _check_cache now reads response, citations, and distance directly from the FT result doc instead of routing through _decode_doc which discarded those fields - Add separate embedder client (EMBEDDING_API_KEY / EMBEDDING_API_BASE_URL) so chat completions and embeddings can use different providers; defaults to the LLM values so OpenAI and Ollama users need no extra config; Anthropic users can point embeddings at any OpenAI-compatible endpoint Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3969de4. Configure here.
| // Check if it's Python (fully supported) | ||
| if (selectedLang === 'python') { | ||
| // Check if it's a supported language | ||
| if (selectedLang === 'python' || selectedLang === 'javascript') { |
There was a problem hiding this comment.
JavaScript missing non-RAG templates
Medium Severity
The builder now treats JavaScript as fully supported for every agent type, but only a rag_agent.js template exists under javascript/. Recommendation and conversational choices still fetch recommendation_agent.js or conversational_agent.js, get a 404, and silently fall back to the generic stub with a TODO instead of the real Redis agent examples users expect.
Reviewed by Cursor Bugbot for commit 3969de4. Configure here.


Adds a third agent type — Knowledge Assistant — to the interactive agent builder, alongside the existing Recommendation Engine and Conversational Assistant. Includes Python and Node.js templates with Redis-native hybrid retrieval, semantic caching, session memory, and citations.
Note
Low Risk
Changes are limited to static docs, Hugo shortcode, client-side builder JS, and example templates—no production auth or data paths.
Overview
Adds a Knowledge Assistant (RAG) as a third agent type in the interactive agent builder, with docs and UI updated to list three agent types and to advertise JavaScript alongside Python for code generation.
The builder flow now includes a Knowledge Assistant suggestion chip,
raginCONFIG(keywords, default nameKnowledgeAssistant), and JavaScript as a first-class language path (not Python-only). Template loading uses Hugo-injectedwindow.AGENT_TEMPLATE_BASEinstead ofHUGO_BASEURLfor fetchingrag_agent(and other) templates.New Python and Node.js
rag_agenttemplates implement document chunking/embedding, RediSearch hybrid retrieval (text pre-filter + KNN with vector fallback), TTL semantic cache, session history in Redis lists, and cited answers; both ship sample Redis docs and skip re-ingestion when the doc index is already populated.Reviewed by Cursor Bugbot for commit 3969de4. Bugbot is set up for automated code reviews on this repo. Configure here.